import request from '@/utils/request'

export function skuTable(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_MALL_API}/api/mall/sku/info/table`,
    method: 'post',
    data: query
  })
}

export function skuSelect(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_MALL_API}/api/mall/sku/info/query/select`,
    method: 'post',
    data: query
  })
}

export function skuDetail(skuId) {
  return request({
    url: `${process.env.VUE_APP_MODULE_MALL_API}/api/mall/sku/info/${skuId}/detail`,
    method: 'post'
  })
}

export function skuSave(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_MALL_API}/api/mall/sku/info/save`,
    method: 'post',
    contentType: 'json',
    data: query
  })
}

export function skuImages(skuId) {
  return request({
    url: `${process.env.VUE_APP_MODULE_MALL_API}/api/mall/sku/info/${skuId}/images`,
    method: 'post'
  })
}

export function skuSaveImages(skuId, query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_MALL_API}/api/mall/sku/info/${skuId}/images/update`,
    method: 'post',
    contentType: 'json',
    data: query
  })
}

export function skuPrice(skuId) {
  return request({
    url: `${process.env.VUE_APP_MODULE_MALL_API}/api/mall/sku/info/${skuId}/price`,
    method: 'post'
  })
}

export function skuSavePrice(skuId, query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_MALL_API}/api/mall/sku/info/${skuId}/price/update`,
    method: 'post',
    contentType: 'json',
    data: query
  })
}
